#! /bin/sh

# PROVIDE: freqbot
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown

# Define freqbot_enable variable in one of these files:
#       /etc/rc.conf
#       /etc/rc.conf.local
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
freqbot_enable="${freqbot_enable-NO}"

. /etc/rc.subr

name=freqbot
rcvar=`set_rcvar`

restart_cmd="freqbot_restart"
start_cmd="freqbot_start"
status_cmd="freqbot_status"
stop_cmd="freqbot_stop"

cd /usr/local


TOOL=/usr/local/sbin/freqtool
BOTUSER=freqbot

freqbot_status()
{
    su $BOTUSER -c "$TOOL status"
}

freqbot_start()
{
    su $BOTUSER -c "$TOOL start"
}

freqbot_stop()
{
    su $BOTUSER -c "$TOOL stop"
}

freqbot_restart()
{
    freqbot_stop
    freqbot_start
}

load_rc_config $name
run_rc_command "$1"
